<template>
	<van-cell-group>
		<van-cell title="仅在Wi-Fi模式下载" is-link>
			<van-switch v-model="check1" size="18px" />
		</van-cell>
		<van-cell title="流量提醒" is-link>
			<van-switch v-model="check2" size="18px" />
		</van-cell>
		<van-cell v-for="(item,i) of setItems" :key="i" :title="item.title" is-link />
		<van-cell title="青少年模式" is-link>
			<van-switch v-model="checked" size="18px" />
		</van-cell>
		<van-cell title="修改密码" is-link @click="onProfile()">
		</van-cell>
		<van-cell @click="onClickLogout" title="退出登录" is-link />
	</van-cell-group>
</template>

<script>
	import {
		removeTokenLocal
	} from "@/utils/auth.js"
	export default {
		data() {
			return {
				checked: true,
				check1: true,
				check2: false,
				setItems: [{
						title: "账户与安全",
					},
					{
						title: "黑名单",
					},
					{
						title: "消息通知",
					},
					{
						title: "管理个性化内容推荐",
					},
					{
						title: "反馈与建议",
					},
					{
						title: "个人信息与权限",
					},
					{
						title: "第三方信息共享清单",
					},
				],
			}
		},
		methods: {
			//点击用户退出事件
			onClickLogout() {
				this.$dialog.confirm({
					title: "退出登录",
					message: "确认要退出当前账号吗",
				}).then(() => {
					removeTokenLocal();
					this.avatar = this.avatar_default;
					this.$toast("退出成功");
					this.isLogin = false;
					this.$router.go(-1);
				}).catch(() => {
					
				});
			},
			onProfile() {
				this.$router.push({
					name: 'updatePwd',
				});
			}
		},
	}
</script>

<style>
</style>
